package dao;

import beans.Whiteboard;
import db.DBQuery;

import java.util.List;

public class WhiteBoardDAO extends CommonDAO<Whiteboard> {

    public final static WhiteBoardDAO ME = new WhiteBoardDAO();

    @Override
    protected String tableName() {
        return "wb_white_board";
    }

    public List<Whiteboard> getWhiteBoardList(long group_id) {
        String sql = "select * from " + tableName() + " where group_id = ?";
        return DBQuery.query_list(Whiteboard.class, sql, group_id);
    }

    public long deleteGroupWhiteBoards(long group_id) {
        String sql = "delete from " + tableName() + " where group_id = ?";
        return DBQuery.update(sql, group_id);
    }
}
